package cuShapes;

import java.awt.Color;
import xml.*;
import java.awt.Graphics2D;
import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.io.Serializable;
import java.awt.Point;
import java.awt.geom.Line2D;

@XmlTransient
public abstract class PQLine implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7387339090010269485L;
	@XmlJavaTypeAdapter(PointAdapter.class)
	@XmlElement(name="p1")
	protected Point p1;
	@XmlJavaTypeAdapter(PointAdapter.class)
	@XmlElement(name="p2")
	protected Point p2;
	@XmlJavaTypeAdapter(ColorAdapter.class)
	@XmlAttribute
	protected Color color;
	
	public Color getColor(){
		return color;
	}
	public abstract void drawLine(Graphics2D g2);
	public abstract Point getStart();
	public abstract Point getEnd();
	public abstract void setStart(Point start);
	public abstract void setEnd(Point end);
	public abstract boolean intersects(Line2D l);
}
